// Observer Pattern.cpp : Defines the entry point for the console application.
//

#include "targetver.h"

#include <stdio.h>
#include <tchar.h>
#include <sstream>
#include <iostream>

#include "Notifier.h"
#include "CountKeys.h"

using namespace std;


int main(int argc, char* argv[])
{
	string inString;
	Notifier* theNotifier = Notifier::getInstance();
	CountKeys *keyEventCounter = new CountKeys();

	theNotifier->subscribe(keyEventCounter, KEY_EVENT);
	//Get a string to parse
	cout << "Enter a string: ";
	std::getline(cin, inString);
	 //Generate key events
	for (int i = 0; i < inString.size(); i++)
	{
		theNotifier->LogEvent(KEY_EVENT, inString.substr(i,1));
	}


	return 0;
}

